package gui.houseeditor;

import gui.houseeditor.strategies.MinimalisticHouseDrawStrategy.WalkerImage;

import java.awt.Point;
import java.util.EventObject;

@SuppressWarnings("serial")
public class HouseDataEvent extends EventObject {

	private int x, y;
	private WalkerImage toDraw;

	public HouseDataEvent(Object o, int x, int y, WalkerImage s) {
		super(o);
		if (!(o instanceof HouseModel))
			throw new IllegalArgumentException("Source is not a HouseModel!");
		this.x = x;
		this.y = y;
		toDraw = s;
	}

	public Point getCellChangedPosition() {
		return new Point(x, y);
	}

	public HouseModel.HouseObject getNewValue() {
		return ((HouseModel) source).getCell(x, y);
	}

	public WalkerImage getImageToDraw() {
		return toDraw;
	}
}
